﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using GameSchoolApplication.Models;
using GameSchoolApplication.Interfaces;

namespace GameSchoolWeb.Tests.Repository
{
    class MockPersonRepository : IPersonRepository
    {
        List<Person> _person = new List<Person>();

        public MockPersonRepository(int count)
        {
            for(int i = 0; i < count; i++)
            {
                _person.Add(new Person { Id = i + 1, Name = "Notandi " + (i + 1), Group = "Student", Email = "test@test.com" });
            }
        }

        public IEnumerable<Person> GetAllPersons()
        {
            return _person;
        }

        public Person GetPersonById(int? id)
        {
            return null;
        }

        public void CreatePerson(Person person)
        {
            _person.Add(person);
        }

        public void DeletePerson(Person personToDelete)
        {
            _person.Remove(personToDelete);
        }

        public void UpdatePerson(Person person)
        {

        }

        public void Dispose()
        {

        }
    }
}
